<?php

for($iRow = 0; $iRow < $nSubDetail; $iRow++){

  if($isApprove){

    $updateTo = $lstSubDetail["WAREHOUSE"][$iRow];

    /**
     * update all the SN
     * associated to this NOTA_SRC
     * to whs which belong to this tx
     */
    $CHandlers->updSnWhs($COracle,
                         $lstSubDetail["MODEL_ID"][$iRow],
                         $updateTo,
                         $lstHeader["NOTA_SRC"][0],
                         $SourceDb);
  }else{

    $updateTo = " ";

    /**
     * update all the SN
     * associated to this NOTA_SRC
     * to ' ' which belong to this tx
     */
    $CHandlers->updSnWhs($COracle,
                         $lstSubDetail["MODEL_ID"][$iRow],
                         $updateTo,
                         $lstHeader["NOTA_SRC"][0],
                         $SourceDb);
  }
}
?>